package com.shanzmoo.admin.web.sys;

import com.shanzmoo.admin.manager.RedisDataManager;
import com.shanzmoo.base.bean.SHttpResponse;
import com.shanzmoo.db.sys.entity.vo.AddressTreeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 基础数据
 * @author: Gzhao 2020/12/8
 */
@Api(tags = "系统-基础数据")
@RestController
@RequestMapping("/sys/base")
public class BaseDataController {

    @Autowired
    private RedisDataManager redisDataManager;

    @GetMapping("addressTree")
    @ApiOperation(value = "地址树")
    public SHttpResponse<List<AddressTreeVo>> getAddressTree(){
        List<AddressTreeVo> re = redisDataManager.getAddressTree();
        return SHttpResponse.ok(re);
    }
}
